<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.sql.*,java.util.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<base href="<%=basePath%>">
<title></title>
<link rel="stylesheet" href="css/pintuer.css">
<link rel="stylesheet" href="css/admin.css">
<script src="js/jquery.js"></script>
<script src="js/pintuer.js"></script>

</head>
<body>
	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>草拟合同</strong>
		</div>
		<div class="body-content">
			<form action="<%=path%>/draft" class="form-x" method="post"
				enctype="multipart/form-data">



				<div class="form-group">
					<div class="label">
						<label>合同编号：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="" name="cno"
							data-validate="required:请输入合同编号" />
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>合同名称：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="" name="cname"
							data-validate="required:请输入合同名称" />
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>合同金额：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="" name="cprice"
							data-validate="required:请输入合同金额" />
						<div class="tips"></div>
					</div>
				</div>




				<div class="form-group">
					<div class="label">
						<label>收付状态：</label>
					</div>
					<div class="field">
						<select name="paystate" class="input w50">
							<option value="1">收</option>
							<option value="2">付</option>
						</select>
						<div class="tips"></div>
					</div>
				</div>



				<div class="form-group">
					<div class="label">
						<label>主要条款：</label>
					</div>
					<div class="field">
						<textarea type="text" class="input" name="mclause" id="mclause"
							style="height: 80px;"></textarea>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>起始时间：</label>
					</div>
					<div class="field">
						<input type="date" name="cstart" class="input w50" value=""
							data-validate="required:请输入履行起始时间" />
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>结束时间：</label>
					</div>
					<div class="field">
						<input type="date" name="cend" class="input w50" value=""
							data-validate="required:请输入履行结束时间" />

						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>上传文件：</label>
					</div>
					<div class="field">
						<input type="file" name="other" data-validate="required:必须附上合同文件，且文件名为合同编号"><br />

						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label></label>
					</div>
					<div class="field">
						<button class="button bg-main icon-check-square-o" onclick="javascript:return compareEnd()"  type="submit">保存</button>
					</div>
				</div>


			</form>
		</div>
	</div>

	<script>
		function compareEnd() {
			var startdate = new Date(($("input[name=cstart]").val()).replace(
					/-/g, "/"));
			var enddate = new Date(($("input[name=cend]").val()).replace(/-/g,
					"/"));
			 var msg = "您确定要保存吗？\n\n请确认！"; 
			 if (confirm(msg)==true){ 
				 if (enddate < startdate) {
						alert("结束日期小于开始日期！");
						return false;
					}
					else
					{
						alert("保存成功！");
						return true;
					}
			 }else{ 
			  return false; 
			 } 
		}
	</script>
</body>
</html>
